﻿using CommonLib;
using CommonLib.Pattern.Pool;
using UnityEngine;

public class ReusableRoleSpeedMultiItem : ReusableObject,IInitByInstruction
{
 	public RoleSpeedMultiEffectItem roleEffect { get; protected set; }

	public void Init(BPInstruction instruction)
	{
		roleEffect.Init(instruction);
	}

	protected override GameObject CreateSelf()
	{
		GameObject prefab = GameResourceLoader.Instance.LoadFromResource<GameObject>("ReusableObject/EffectSpeedMulti");
		//base.CreateSelf();
		IsCreated = true;
		roleEffect = Instantiate(prefab).GetComponent<RoleSpeedMultiEffectItem>();
		roleEffect.EndAction += (self) =>
		{
			this.UnUse();
		};
		return roleEffect.gameObject;
	}
}
